<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" 
	template="/template/template.xhtml">
  
  <ui:define name="center">
  	<h1 class="title ui-widget-header ui-corner-all">${msg['admin.author.title']}</h1>
  	<h:messages id="success" layout="table"/>
  	<h:form id="authorForm">
	 	<h:panelGrid columns="2">  
  			<h:outputText value="${msg['admin.form.author.firstname']}*"/>
  			<p:inputText value="#{authorBean.selectedAuthor.firstName}" required="true" requiredMessage="${msg['admin.error.firstName']}"/>
  			<h:outputText value="${msg['admin.form.author.lastname']}*"/>
  			<p:inputText value="#{authorBean.selectedAuthor.lastName}" required="true" requiredMessage="${msg['admin.error.lastName']}"/>
  		
  			<p:commandButton action="#{authorBean.quitAction}" value="${msg['admin.form.quit']}" 
  				ajax="false" />
  			<p:commandButton action="#{authorBean.save}" value="${msg['admin.form.add']}" 
  				ajax="false" rendered="#{authorBean.selectedAuthor.id eq null}" />
  			<p:commandButton action="#{authorBean.merge}" value="${msg['admin.form.modify']}" 
  				ajax="false" rendered="#{authorBean.selectedAuthor.id ne null}"/>
  		</h:panelGrid>
  	</h:form>
  </ui:define>
</ui:composition>